<?php
/**
 * 注册类的自动加载
 * User: lisgroup
 * Date: 2017/11/2
 * Time: 11:13
 */

spl_autoload_register(function($class) {
    if (0 === stripos($class, 'Apps\\')) {
        $filename = __DIR__.'/'.str_replace(['\\', 'Apps/',], ['/', 'src/'], $class).'.php';
        //$filename = __DIR__ . '/' . str_replace('\\', '/', $class) . '.php';
        file_exists($filename) && require_once($filename);
    }
});